package com.creative.accountsdk.net.account;

import android.util.Log;

import com.creative.accountsdk.UmsChannel;
import com.creative.accountsdk.UserData;
import com.creative.accountsdk.bean.CourseInfo;
import com.creative.accountsdk.net.Protocol;
import com.creative.accountsdk.net.XParams;
import com.loopj.android.http.RequestParams;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * 教师 -  选择任教 （选择任教）
 *
 *
 * @author  David
 * @version 1.0
 * @created 2015-11-25
 */
public class SelectCourseProtocol extends Protocol {

    public JSONObject      returnMap;

    public List<CourseInfo> courseList;
    UserData  userData;
    private long  classId;
    private int    header;
    private String courses;
    public SelectCourseProtocol(long  classId,int header,String courses){
        userData = UserData.getInstance();
        this.classId = classId;
        this.header= header;
        this.courses = courses;
    }
    @Override
    public RequestParams getParams() {
        return new XParams()
                .put("uid", userData.getUid())
                .put("classid",classId)
                .put("header",header)
                .put("courses",courses)
                .put(UmsChannel.PARAM_NAME, UmsChannel.getChannel())
                .getParams();
    }

    @Override
    public String getUrl() {
        return getUrlPrefix()+"class/t/inout/office";
    }

    @Override
    protected void parseReturnMap(JSONObject returnMap) {
        this.returnMap = returnMap;
         Log.e("Tag", "返回课程列表信息.." + returnMap.toString());
    }

}
